<template>
  <div class="wrap">
		<div class="detail-box">
			<div class="detail-title">
				<h1>{{content.title}}</h1>
				<p>
					<span>{{time}}</span>
					<span>掌上新开铺</span>
				</p>
			</div>
			<div class="detail-main" v-html="content.htmlContent">
			</div>
		</div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      id: '',
      content: '',
			community: '',
			time: ''
    }
  },
  methods: {
    getParams () {
      var that = this
      that.id = that.$route.query.id
			that.community = that.$route.query.community
      that.$axios.requestget('/page/category/article?categoryId='+that.id+'&community='+that.community)
        .then((res) => {
          that.content = res
					var date = new Date(that.content.publishDate)
					document.title = res.title
					that.time = date.getFullYear() +'-'+ (date.getMonth()+1) +'-'+ date.getDate()
        })
    }
  },
  mounted () {
    this.getParams()
  }
}
</script>

<style>
</style>
